<template>
  <div class="kar-1">
    <div>
      <div class="text-t">姓名：<span class="text-t1">大学英语</span></div>
      <div class="text-t">姓名：<span class="text-t1">大学英语</span></div>
      <div class="text-t">姓名：<span class="text-t1">大学英语</span></div>
      <div class="text-t">姓名：<span class="text-t1">大学英语</span></div>
    </div>
    <van-radio name="a" @click="addxu" v-if="flag"></van-radio>
  </div>
</template>

<script lang="ts" setup>
import { inject } from 'vue'
import { computed } from 'vue'
interface AddksMethods {
  affirm: Function
}
const affirms = inject<AddksMethods | null>('affirm', null)
const flags = inject<boolean>('flag', false)
const addxu = () => {
  if (affirms) {
    affirms.affirm()
  } else {
    console.log('没有数据')
  }
}
const flag = computed(() => {
  return flags
})
</script>

<style lang="scss" scoped>
.kar-1 {
  width: 100%;
  height: 150px;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-sizing: border-box;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.text-t {
  margin-bottom: 10px;
}
.text-t1 {
  margin-left: 20px;
}
</style>
